{include file="header"}
<div style="padding: 20px;" class="adminmyucms">
<form class="layui-form" action="">
<table class="layui-table">
  <colgroup>
  	 <col width="400">
    <col>
  </colgroup>
  <tbody>
    <tr>
      <td><input type="text" name="title" value=""  placeholder="例如管理员" autocomplete="off" lay-verify="required" class="layui-input"></td>
      <td><button class="layui-btn layui-btn-warm" lay-submit lay-filter="set-add">添加会员组</button></td>
    </tr>
  </tbody>
</table>
</form>
<hr style="padding:10px; background-color: #fff">
<table class="layui-table">
  <thead>
    <tr>
      <th>ID</th>
      <th>会员组名</th>
      <th>操作</th>
      <th>权限</th>
    </tr> 
  </thead>
  <tbody>
  	{volist name="html" id="vo"}
    <tr  class="layui-form">
      <th>{$vo.id}</th>
      <th>{$vo.title}</th>
            <td>
        {if condition="$vo['open'] eq '1'"}显示{else /}隐藏{/if}
      </td>
      <th id="admin_set">
      	<a class="layui-btn layui-btn-sm layui-btn-normal" data-method="admin_set" member-id="{$vo.id}" url="/admin.php/user/edit/id/{$vo.id}"><i class="layui-icon">&#xe642;</i> 配置权限</a>
      	      	<div class="layui-btn-group">
      		 
      		 <a  member-name="确定要删除这条记录吗?" url="{:url("set/delete")}?id={$vo.id}&m=userZu" lay-submit lay-filter="delete"  class="layui-btn layui-btn-danger layui-btn-sm"> <i class="layui-icon">&#xe640;</i>删除</a>
        </div>
      </th>
    </tr>
    {/volist} 
  </tbody>
</table>
 
<div class="pages">
{$html->render()}
<div>
</div> 
<script>
layui.use('form',function(){
  var form = layui.form
  ,jq = layui.jquery;
 
  //添加
  form.on('submit(set-add)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("user/insertzu")}',param,function(data){
      if(data.code == 1){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.reload();
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });
})
layui.use('laydate', function(){
  var laydate = layui.laydate;
  laydate.render({
    elem: '#time'
  });
});
</script>
{include file="footer"}